import fetch from 'common/src/utils/fetch';

let api = {
    // 查询列表
    getList(data) {
        return fetch({
            url: '/api/majorservice/crossFeaturedResult/queryByPage',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        });
    },
    // 联动根据年级查询大类
    getMajorByGrade(data) {
        return fetch({
            url: '/api/welcomeservice/tutorSchool/major/' + data,
            method: 'get',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        });
    },
    // 联动根据年级和大类查询志愿专业
    getSubjectByGradeAndMajor(gradeId, majorCode) {
        return fetch({
            url: 'api/commonservice/campusProfession/findProfessionByBigProfession?grade=' + gradeId + '&bigProfessionCode=' + majorCode,
            method: 'get',
            headers: {
                'Content-Type': 'application/json'
            },
        });
    },
    // 联动根据大类查询学院
    queryCollegeByMajorCode(volunteerMajorId = '', gradeId = '') {
        return fetch({
            url: 'api/majorservice/crossResultType/queryCollegeByMajorCode?volunteerMajorId=' + volunteerMajorId + '&gradeId=' + gradeId,
            method: 'get',
            headers: {
                'Content-Type': 'application/json'
            }
        });
    },
    // 录入
    entry(data) {
        return fetch({
            url: '/api/majorservice/crossFeaturedResult/insert',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        });
    },
    // 修改
    update(data) {
        return fetch({
            url: '/api/majorservice/crossFeaturedResult/update',
            method: 'put',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        });
    },
    // 导出
    export (data) {
        return fetch({
            url: '/api/majorservice/crossFeaturedResult/exportList',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        });
    },
    getReportStatus(key) {
        return fetch({
            url: `/api/majorservice/common/exportExcelResult/${key}`,
            method: 'get',
            showMask: false
        });
    },
    // 数据分权，选择年级查专业大类
    getMajorByGradeAndTid(data) {
        return fetch({
            url: '/api/majorservice/classPrivilege/queryMajorByGidAndTid',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        });
    },
    // 选择专业大类查专业
    findVoluntaryMajor(data) {
        return fetch({
            url: '/api/majorservice/enrolPlan/findVoluntaryInfoClassVoById',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data: data
        });
    },
 getSubject(college, gradeId) {
    return fetch({
                   url: `/api/majorservice/common/subject?college=${college}&gradeId=${gradeId}`,
                   method: 'get',
                   showMask: false
                 });
  },

  getMajor(subjectId, gradeId) {
    return fetch({
                   url: `/api/majorservice/common/major?subjectId=${subjectId}&gradeId=${gradeId}`,
                   method: 'get',
                   showMask: false
                 });
  },

  getCollege(authId) {
    return fetch({
                   url: `/api/majorservice/common/college?authId=${authId}`,
                   method: 'get',
                   showMask: false
                 });
  }
};
export default api;
